import { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import styles from './index.module.scss'
import classNames from 'classnames'
import PropTypes from 'prop-types'
import { getBrand } from '@/utils/storage'

export default class NeedScore extends Component {
  props: any

  static propTypes = {
    goods: PropTypes.object,
    price: PropTypes.number,
    unitSize: PropTypes.number,
    priceSize: PropTypes.number,
    className: PropTypes.string,
  }

  render () {
    const prefixCls = 'need-score'
    const { goods={}, price, priceSize=32, unitSize=32, className } = this.props
    return (
      <View className={classNames(styles[prefixCls], 'bnn-number', className)}>
        <View className={classNames(styles[`${prefixCls}-num`], `f-s-${priceSize}`)}>{price ? price : goods.needScore}</View>
        <View className={classNames(styles[`${prefixCls}-unit`], `f-s-${unitSize}`)}>{getBrand()}</View>
      </View>
    )
  }
}
